#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>

#include "util.h"
#include "header.h"

void vc4FrameBodyToVc4FrameHeader(vc4FrameBody_t body, vc4FrameHead_t *pHeader, uint16_t logicalID, uint16_t physicalID,
                                uint16_t SQ, uint16_t frameLen, uint16_t frameNum, int vcType) {
    pHeader->logicalChannelID = logicalID;
    pHeader->physicalChannelID = physicalID;
    pHeader->SQ = SQ;
    pHeader->frameLength= frameLen;
    pHeader->frameNum = frameNum;
    pHeader->vcType = vcType;

    pHeader->frameBody.MFI = body.MFI;
    memcpy(pHeader->frameBody.load,body.load,getVC4BodyLength());
}


long getVC4BodyLength(){
    return VC4_FRAME_BODY_LENGTH;
}
long getVC12BodyLength(){
    return VC12_FRAME_BODY_LENGTH;
}
long getVC4HeaderLength(){
    return VC4_FRAME_HEADER_LENGTH;
}
long getVC12HeaderLength(){
    return VC12_FRAME_HEADER_LENGTH;
}
